<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <!--IE Compatibility modes-->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!--Mobile first-->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <title>403</title>

    <meta name="description" content="Free Admin Template Based On Twitter Bootstrap 3.x">
    <meta name="author" content="">

    <meta name="msapplication-TileColor" content="#5bc0de"/>
    <meta name="msapplication-TileImage" content="assets/img/metis-tile.png"/>

    <!-- Bootstrap -->
    <link href="//cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

    <!-- Font Awesome -->
    <!--<link rel="stylesheet" href="assets/lib/font-awesome/css/font-awesome.min.css">-->
    <link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="/assets/lib/bootstrap-table/bootstrap-table.min.css">
    <link rel="stylesheet" href="/assets/lib/bootstrap-switch/css/bootstrap3/bootstrap-switch.min.css">
    <!-- Metis core stylesheet -->
    <link rel="stylesheet" href="/assets/css/main.css">
    <!-- animate.css stylesheet -->
    <link rel="stylesheet" href="/assets/lib/animate.css/animate.css"/>
    <link rel="stylesheet" href="/assets/lib/select2/css/select2.min.css"/>
    <link rel="stylesheet" href="/assets/lib/bootstrap-validator/css/bootstrapValidator.min.css"/>
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="//oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="//oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <style>
        .text_info {
            border: 0px;
        }
    </style>


    <![endif]-->
</head>

<body>
<div class="bg-dark dk" id="wrap" style="height:50px;">
    <header class="head">
        <div class="">
            <ol class="breadcrumb" style="background-color: #3a3a3a">
                <li><a href="javascript:void(0);"> <i class="fa fa-home">首页</i></a></li>
            </ol>
        </div>
        <!-- /.main-bar -->
    </header>
</div>
<div class="container" style="width:100%;">
    <div class="row">
        <div class="col-lg-12">
            <div class="box">
                <div id="collapse" class="body">
                    <a data-placement="bottom" data-original-title="" href="sysu/storeApply" data-toggle="tooltip"
                       class="btn btn-default btn-sm">
                        <i class="fa fa-flag"></i>店铺申请审核
                        <span id="store_apply" class="label label-danger"></span>
                    </a>
                    <a data-placement="bottom" data-original-title="" href="sysu/storeChangeApply" data-toggle="tooltip"
                       class="btn btn-default btn-sm">
                        <i class="fa fa-flag"></i>店铺信息变更审核
                        <span id="store_change" class="label label-danger"></span>
                    </a>
                    <a data-placement="bottom" data-original-title="Help" href="sysf/withdraw" data-toggle="modal" 
                       class="btn btn-default btn-sm">
                        <i class="fa fa-flag"></i>提现申请审核
                        <span id="withdraw" class="label label-danger"></span>
                    </a>
                    <a  data-placement="bottom" data-original-title="Help" href="sysf/transfer" data-toggle="modal"
                       class="btn btn-default btn-sm">
                        <i class="fa fa-flag"></i>代理商提现申请审核
                        <span id="agent_withdraw" class="label label-danger"></span>
                    </a>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-12">
            <div class="box dark">
                <header>
                    <div class="icons"><i class="fa fa-th-large"></i></div>
                    <h5>平台信息统计</h5>
                    <!-- .toolbar -->
                    <div class="toolbar">
                        <nav style="padding: 8px;">
                        </nav>
                    </div>            <!-- /.toolbar -->
                </header>
                <div id="div-1" class="body">
                    <div class=" clearfix">
                        <div class="col-lg-2 col-sm-6">
                            <section class="panel" style="border: 4px solid #dddddd;background-color: #FF5809">
                                <div style="">
                                    <h2 id="today_num" style="color: whitesmoke" align="center"></h2>
                                    <p style="margin-left: 10px;margin-bottom:25px;color: whitesmoke;font-size: 25px" align="center">今日交易金额</p>
                                </div>
                            </section>
                        </div>
                        <div class="col-lg-2 col-sm-6">
                            <section class="panel" style="border: 4px solid #dddddd;background-color: #27a9e3">
                                <div style="">
                                    <h2 id="yesterday_num" style="color: whitesmoke" align="center"></h2>
                                    <p style="margin-left: 10px;margin-bottom:25px;color: whitesmoke;font-size: 25px" align="center">昨日交易金额</p>
                                </div>
                            </section>
                        </div>
                        <div class="col-lg-2 col-sm-6">
                            <section class="panel" style="border: 4px solid #dddddd;background-color: #00BB00">
                                <div style="">
                                    <h2 id="platform_num" style="color: whitesmoke" align="center"></h2>
                                    <p style="margin-left: 10px;margin-bottom:25px;color: whitesmoke;font-size: 25px" align="center">平台交易总额</p>
                                </div>
                            </section>
                        </div>
                        <div class="col-lg-2 col-sm-6">
                            <section id="merchantDetail" class="panel" style="border: 4px solid #dddddd;background-color: #AE00AE;cursor:pointer">
                                <div style="">
                                    <h2 id="merchant_num" style="color: whitesmoke" align="center"></h2>
                                    <p style="margin-left: 10px;margin-bottom:25px;color: whitesmoke;font-size: 25px" align="center">商户收入</p>
                                </div>
                            </section>
                        </div>
                        <div class="col-lg-2 col-sm-6" id="company_num1" href="/syslog/companyProfit">
                            <section id="companyProfit" class="panel" style="border: 4px solid #dddddd;background-color: #D9006C;cursor:pointer">
                                <div style="">
                                    <h2 id="company_num" style="color: whitesmoke" align="center"></h2>
                                    <p style="margin-left: 10px;margin-bottom:25px;color: whitesmoke;font-size: 25px" align="center">公司利润池</p>
                                </div>
                            </section>
                        </div>
                        <div class="col-lg-2 col-sm-6" id="company_fund1">
                            <section id="companyFund" class="panel" style="border: 4px solid #dddddd;background-color: #930000;cursor:pointer">
                                <div style="">
                                    <h2 id="company_fund" style="color: whitesmoke" align="center"></h2>
                                    <p style="margin-left: 10px;margin-bottom:25px;color: whitesmoke;font-size: 25px" align="center">公司资金池</p>
                                </div>
                            </section>
                        </div>
                        <div class="col-lg-2 col-sm-6" id="market_fund1">
                            <section id="marketFund" class="panel" style="border: 4px solid #dddddd;background-color: #5B5B5B;cursor:pointer">
                                <div style="">
                                    <h2 id="market_fund" style="color: whitesmoke" align="center"></h2>
                                    <p style="margin-left: 10px;margin-bottom:25px;color: whitesmoke;font-size: 25px" align="center">市场资金池</p>
                                </div>
                            </section>
                        </div>
                        <div class="col-lg-2 col-sm-6" id="bonus_fund1">
                            <section id="companyBonus" class="panel" style="border: 4px solid #dddddd;background-color: #6F00D2;cursor:pointer" >
                                <div style="">
                                    <h2 id="bonus_fund" style="color: whitesmoke" align="center"></h2>
                                    <p style="margin-left: 10px;margin-bottom:25px;color: whitesmoke;font-size: 25px" align="center">奖金资金池</p>
                                </div>
                            </section>
                        </div>
                        <div class="col-lg-2 col-sm-6" id="poundage_fund1">
                            <section id="companyPoundage" class="panel" style="border: 4px solid #dddddd;background-color: #0000E3;cursor:pointer" >
                                <div style="">
                                    <h2 id="poundage_fund" style="color: whitesmoke" align="center"></h2>
                                    <p style="margin-left: 10px;margin-bottom:25px;color: whitesmoke;font-size: 25px" align="center">手续费资金池</p>
                                </div>
                            </section>
                        </div>
                        <div class="col-lg-2 col-sm-6" id="market_msk1">
                            <section id="marketMs" class="panel" style="border: 4px solid #dddddd;background-color: #EA7500;cursor:pointer">
                                <div style="">
                                    <h2 id="market_msk" style="color: whitesmoke" align="center"></h2>
                                    <p style="margin-left: 10px;margin-bottom:25px;color: whitesmoke;font-size: 25px" align="center">市场MS</p>
                                </div>
                            </section>
                        </div>
                        <div class="col-lg-2 col-sm-6"  id="company_msk1">
                            <section id="companyMs" class="panel" style="border: 4px solid #dddddd;background-color: #AE57A4;cursor:pointer">
                                <div style="">
                                    <h2 id="company_msk" style="color: whitesmoke" align="center"></h2>
                                    <p style="margin-left: 10px;margin-bottom:25px;color: whitesmoke;font-size: 25px" align="center">公司MS</p>
                                </div>
                            </section>
                        </div>
                        <div class="col-lg-2 col-sm-6">
                            <section id="user" class="panel" style="border: 4px solid #dddddd;background-color: #00AEAE;cursor:pointer">
                                <div style="">
                                    <h2 id="common_num" style="color: whitesmoke" align="center"></h2>
                                    <p style="margin-left: 10px;margin-bottom:25px;color: whitesmoke;font-size: 25px" align="center">普通用户</p>
                                </div>
                            </section>
                        </div>
                        <div class="col-lg-2 col-sm-6">
                            <section id="orig" class="panel" style="border: 4px solid #dddddd;background-color: #02C874;cursor:pointer">
                                <div style="">
                                    <h2 id="original_num" style="color: whitesmoke" align="center"></h2>
                                    <p style="margin-left: 10px;margin-bottom:25px;color: whitesmoke;font-size: 25px" align="center">原始用户</p>
                                </div>
                            </section>
                        </div>
                        <div class="col-lg-2 col-sm-6">
                            <section id="store" class="panel" style="border: 4px solid #dddddd;background-color: #0000E3;cursor:pointer">
                                <div style="">
                                    <h2 id="store_outline" style="color: whitesmoke" align="center"></h2>
                                    <p style="margin-left: 10px;margin-bottom:25px;color: whitesmoke;font-size: 25px" align="center">店铺商家</p>
                                </div>
                            </section>
                        </div>
                        <div class="col-lg-2 col-sm-6">
                            <section id="store2" class="panel" style="border: 4px solid #dddddd;background-color: #A6A600;cursor:pointer">
                                <div style="">
                                    <h2 id="store_online" style="color: whitesmoke" align="center"></h2>
                                    <p style="margin-left: 10px;margin-bottom:25px;color: whitesmoke;font-size: 25px" align="center">企业商家</p>
                                </div>
                            </section>
                        </div>
                        <div class="col-lg-2 col-sm-6">
                            <section id="merchantAgent" class="panel" style="border: 4px solid #dddddd;background-color: #C6A300;cursor:pointer">
                                <div style="">
                                    <h2 id="agent_num" style="color: whitesmoke" align="center"></h2>
                                    <p style="margin-left: 10px;margin-bottom:25px;color: whitesmoke;font-size: 25px" align="center">代理商</p>
                                </div>
                            </section>
                        </div>

                        <div class="col-lg-2 col-sm-6">
                            <section class="panel" style="border: 4px solid #dddddd;background-color: #AD5A5A">
                                <div style="">
                                    <h2 id="core_num" style="color: whitesmoke" align="center"></h2>
                                    <p style="margin-left: 10px;margin-bottom:25px;color: whitesmoke;font-size: 25px" align="center">睿积分账户总额</p>
                                </div>
                            </section>
                        </div>
                        <div class="col-lg-2 col-sm-6">
                            <section class="panel" style="border: 4px solid #dddddd;background-color: #A5A552">
                                <div style="">
                                    <h2 id="consume_num" style="color: whitesmoke" align="center"></h2>
                                    <p style="margin-left: 10px;margin-bottom:25px;color: whitesmoke;font-size: 25px" align="center">消费账户总额</p>
                                </div>
                            </section>
                        </div>
                        <div class="col-lg-2 col-sm-6">
                            <section class="panel" style="border: 4px solid #dddddd;background-color: #5CADAD">
                                <div style="">
                                    <h2 id="ori_num" style="color: whitesmoke" align="center"></h2>
                                    <p style="margin-left: 10px;margin-bottom:25px;color: whitesmoke;font-size: 25px" align="center">原始积分总额</p>
                                </div>
                            </section>
                        </div>
                        <div class="col-lg-2 col-sm-6">
                            <section class="panel" style="border: 4px solid #dddddd;background-color: #8080C0">
                                <div style="">
                                    <h2 id="profit_num" style="color: whitesmoke" align="center"></h2>
                                    <p style="margin-left: 10px;margin-bottom:25px;color: whitesmoke;font-size: 25px" align="center">分润账户总额</p>
                                </div>
                            </section>
                        </div>


                    </div>
                </div>
            </div>
        </div>

        <!--END TEXT INPUT FIELD-->
    </div>

    <div class="row">
        <div class="col-lg-12">
            <div class="box">
                <div id="collapse4" class="body">
                    <!--<table id="dataTable" class="table table-bordered table-condensed table-hover table-striped">
                        <tbody></tbody>
                    </table>-->
                    <div id="main" style="width: 100%;height:400px;"></div>
                </div>
            </div>
        </div>
    </div>

    <div id="add_modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         data-backdrop="static"
         aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header ">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h5 class="modal-title">
                        <i class="icon-pencil"></i>
                        <span data-type="add" style="font-weight:bold">流水</span>
                    </h5>
                </div>
                <table id="dataTable" class="table table-bordered table-condensed table-hover table-striped">
                    <tbody></tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<!--jQuery -->
<script src="/assets/lib/jquery/jquery.min.js"></script>
<!--Bootstrap -->
<script src="/assets/lib/bootstrap/js/bootstrap.min.js"></script>
<script src="/assets/lib/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/assets/lib/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="/assets/lib/bootstrap-switch/js/bootstrap-switch.min.js"></script>
<script src="/assets/lib/select2/js/select2.min.js"></script>
<script src="/assets/lib/bootstrap-validator/js/bootstrapValidator.min.js"></script>
<!-- MetisMenu -->
<script src="/assets/lib/metismenu/metisMenu.js"></script>
<!-- Metis core scripts -->
<script src="/assets/js/core.js"></script>
<script src="/assets/js/distpicker.data.js"></script>
<script src="/assets/js/distpicker.js"></script>
<script src="/assets/js/utils.js"></script>
<script src="/assets/js/echarts.min.js" ></script>

<!-- Metis demo scripts -->
<script src="/assets/js/app.js"></script>
<script src="/assets/lib/layer/layer.js"></script>
<script>
    var csrf_token = "${_csrf.token}";
    $.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': csrf_token
        }
    });
    layer.config({
        extend: 'extend/layer.ext.js'
    });

    //每隔10分钟刷新
	setInterval("getNewInfoNum()", 600000);
    
    //获取最新申请数
    function getNewInfoNum(){
    	$.ajax({
    		type: "GET",
    		dataType: "json",
    		url: "/homeCount",
    		success: function (res){
    			$("#store_apply").text(res.data.storeApply);
    			$("#store_change").text(res.data.storeChange);
    			$("#withdraw").text(res.data.withdraw);
    			$("#agent_withdraw").text(res.data.agentWithdraw);
			}
		})
	}

	$.ajax({
		type : "GET",
		dataType : "json",
		url : "/homeCount",
		success : function(res) {
			if (res.data.todayNum == null) {
				$("#today_num").append(0);
			} else {
				$("#today_num").append(res.data.todayNum);
			}
			if (res.data.yesterdayNum == null) {
				$("#yesterday_num").append(0);
			} else {
				$("#yesterday_num").append(res.data.yesterdayNum);
			}
			if (res.data.platformNum == null) {
				$("#platform_num").append(0);
			} else {
				$("#platform_num").append(res.data.platformNum);
			}

			$("#merchant_num").append(res.data.merchantNum);
			$("#store_apply").append(res.data.storeApply);
			$("#store_change").append(res.data.storeChange);
			$("#withdraw").append(res.data.withdraw);
			$("#agent_withdraw").append(res.data.agentWithdraw);
			$("#company_num").append(res.data.platform.companyProfitPool);
			$("#company_fund").append(res.data.platform.companyFundPool);
			$("#market_fund").append(res.data.platform.marketFundPool);
			$("#bonus_fund").append(res.data.platform.bonusPool);
			$("#poundage_fund").append(res.data.platform.poundagePool);
			$("#common_num").append(res.data.commonNum);
			$("#original_num").append(res.data.originalNum);
			$("#store_outline").append(res.data.storeOutline);
			$("#store_online").append(res.data.storeOnline);
			$("#agent_num").append(res.data.agentNum);
			$("#market_msk").append(res.data.platform.marketMsk);
			$("#core_num").append(res.data.coreNum);
			$("#consume_num").append(res.data.consumeNum);
			$("#ori_num").append(res.data.oriNum);
			$("#profit_num").append(res.data.profitNum);
			$("#company_msk").append(res.data.platform.companyMsk);
		},
		error : function(xhr, errorType, error) {
			layer.msg("获取失败", {icon: 7});
		}
	});

	var cate = [];
	var price = [];

	$.ajax({
		type : "GET",
		dataType : "json",
		url : "/MSKPrice",
		async : false,
		success : function(res) {
			res.data.forEach(function(e) {
				cate.push(new Date(e.createTime).toLocaleString());
				price.push(e.price);
			});
		},
		error : function(xhr, errorType, error) {
			layer.msg("获取失败", {icon: 7});
		}
	});

	var myChart = echarts.init(document.getElementById('main'));

	option = {
		title : {
			text : 'MS价格波动'
		},
		tooltip : {
			trigger : 'axis',
			axisPointer : {
				type : 'cross',
				label : {
					backgroundColor : '#6a7985'
				}
			}
		},
		legend : {
			data : [ 'MS价格走势' ]
		},
		toolbox : {
			feature : {
				saveAsImage : {}
			}
		},
		grid : {
			left : '3%',
			right : '4%',
			bottom : '3%',
			containLabel : true
		},
		xAxis : [ {
			type : 'category',
			boundaryGap : false,
			data : cate
		} ],
		yAxis : [ {
			type : 'value'
		} ],
		series : [ {
			name : 'MS单价',
			type : 'line',
			stack : '总量',
			areaStyle: {normal: {}},
			data : price
		} ]
	};

	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(option);

	// 用于server 分页，表格数据量太大的话 不想一次查询所有数据，可以使用server分页查询，数据量小的话可以直接把sidePagination: "server"  改为 sidePagination: "client" ，同时去掉responseHandler: responseHandler就可以了，
	function responseHandler(res) {

		if (res) {
			return {
				"rows" : res.result,
				"total" : res.totalCount
			};
		} else {
			return {
				"rows" : [],
				"total" : 0
			};
		}
	}
	function queryParams(params) {
		var param = {
			pageNumber : this.pageNumber,
			pageSize : this.pageSize
		};
		return param;
	}

	//跳转到商户货款明细
	$("#merchantDetail").click(function() {
		window.location.href = "sysf/merchant";
	})
	//跳转到公司利润池流水
	$("#companyProfit").click(function() {
		window.location.href = "syslog/companyProfit";
	})
	//跳转到公司资金池流水
	$("#companyFund").click(function() {
		window.location.href = "syslog/companyFund";
	})
	//跳转到市场资金池流水
	$("#marketFund").click(function() {
		window.location.href = "syslog/marketFund";
	})
	//跳转到公司奖金池流水
	$("#companyBonus").click(function() {
		window.location.href = "syslog/companyBonus";
	})
	//跳转到手续费资金池流水
	$("#companyPoundage").click(function() {
		window.location.href = "syslog/companyPoundage";
	})
	//跳转到市场MS流水
	$("#marketMs").click(function() {
		window.location.href = "syslog/marketMs";
	})
	//跳转到公司MS流水
	$("#companyMs").click(function() {
		window.location.href = "syslog/companyMs";
	})
	//跳转到会员管理
	$("#user").click(function() {
		window.location.href = "sysu/user";
	})
	//跳转到原积分用户管理
	$("#orig").click(function() {
		window.location.href = "sysu/orig";
	})
	//跳转到店铺
	$("#store").click(function() {
		window.location.href = "sysu/store";
	})
	//跳转到店铺
	$("#store2").click(function() {
		window.location.href = "sysu/store";
	})
	//跳转到代理商管理
	$("#merchantAgent").click(function() {
		window.location.href = "sys/merchantAgent";
	})
</script>
</body>

</html>
